package grape.base.rest.dept.mvc;

import grape.base.service.dept.api.IDeptService;
import grape.base.service.dept.po.Dept;
import grape.common.rest.advice.DisableGRB;
import grape.common.rest.advice.DisableGRM;
import grape.common.rest.mvc.SuperController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * <p>
 * 部门内部调用接口
 * </p>
 *
 * @author yangwei
 * @since 2019-5-8
 */
@RestController
@RequestMapping("/base/dept")
@ApiIgnore
public class DeptInnerController extends SuperController {
    @Autowired
    private IDeptService iDeptService;

    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/trans/support")
    public boolean support(String type){
        return iDeptService.support(type);
    }
    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/trans")
    public String trans(String type,String key){
        return iDeptService.trans(type,key);
    }


    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/getDeptById")
    public Dept getDeptById(String id){
        return iDeptService.getById(id);
    }

    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/getDeptByCode")
    public Dept getDeptByCode(String code){
        return iDeptService.getByCode(code);
    }

}
